#include<fstream>
#include<string>
#include<cmath>
#include<iostream>
#include<vector>
#include<ctime>
#include<utility>
using namespace std;

inline void check(bool success,const string& msg="error")
{
	if(!success)
	{
		cerr<<msg<<endl;
		exit(-1);
	}
	return;
}

string read(const string& filename)
{
	ifstream in(filename.c_str());
	check(in,filename+":cannot open");
	string line;
	string data;
	while(in>>line)
		data.append(line);
	in.close();
	return move(data);
}

int FDR(const string& data)
{
	vector<int> Dic(4096, -1);
	int fdr = 0;
	for (int i = 0; i < data.size(); i++)
	{
		int l = 0;
		while (i < data.size()&&data.at(i) != '1')
		{
			i++;
			l++;
		}
		if (Dic[l] == -1)
		{
			int group = int(ceil((log(l + 3.0) / log(2.0) - 1)));
			Dic[l] = group << 1;
		}
		fdr += Dic[l];
	}
	return fdr;
}

int main(int argc,char *argv[])
{
	long _t=clock();
	if(argc!=2)
		cout<<"FDR filename"<<endl;
	else
	{
		string data=read(argv[1]);
		double r=1-(double)FDR(data)/data.size();
		printf("%.2f\n",r*100);
	}
	cout<<clock()-_t<<endl;
	return 0;
}